#include "global.h"
#include "housemasterindex.h"
#include "ui_housemasterindex.h"
#include "h_needmanage.h"
#include "h_stushow.h"

#include <QSqlQuery>

houseMasterIndex::houseMasterIndex(QWidget *parent) :
    QDialog(parent),
    ui(new Ui::houseMasterIndex)
{
    ui->setupUi(this);

    //获取姓名
    QString sql=QString("select hname from housemaster where hid='%1'").arg(global::userid);
    QSqlQuery query;
    query.exec(sql);
    QString qname;
    while(query.next())
        qname=QString("欢迎你，%1").arg(query.value(0).toString());
    ui->helloText->setText(qname);
}

houseMasterIndex::~houseMasterIndex()
{
    delete ui;
}

void houseMasterIndex::on_needManage_clicked()
{
    h_needManage window;
    window.exec();
}


void houseMasterIndex::on_stuShowBtn_clicked()
{
    h_stuShow window;
    window.exec();
}

